package com.znufe.exam.viewmodel.admin.student;

import com.znufe.exam.domain.students.StudentResponseObject;
import com.znufe.exam.utility.DateTimeUtil;
import com.znufe.exam.viewmodel.BaseVM;
import lombok.Data;

@Data
public class StudentResponseVM extends BaseVM {

    private Integer id;

    private Integer voteId;

    private String className;

    private String stuName;

    private Integer gender;

    private String stuPhone;

    private String note;

    private String createTime;

    private Integer isEnabled;

    public static StudentResponseVM from(StudentResponseObject obj) {
        StudentResponseVM vm = modelMapper.map(obj, StudentResponseVM.class);
        vm.setCreateTime(DateTimeUtil.dateFormat(obj.getCreateTime()));
        return vm;
    }
}
